package com.sample.servicefragment;

import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStoreOwner;

/**
 * 扩展 ViewModelProviders,以支持 AbstractDummyFragment
 */
public class ViewModelProviders extends androidx.lifecycle.ViewModelProviders {

    @NonNull
    @MainThread
    public static ViewModelProvider of(@NonNull ViewModelStoreOwner owner) {
        return new ViewModelProvider(owner);
    }

    @NonNull
    @MainThread
    public static ViewModelProvider of(@NonNull DummyServiceFragment fragment) {
        return new ViewModelProvider(fragment.getViewModelStoreOwner());
    }
}
